package com.ipharma.interfaces.fingerprint;

import java.awt.Container;

public class ExternalIdentificator 
{
  Container parent;
  FingerPrint fp;

  /**
   * Constructor
   */
  public ExternalIdentificator( Container pCont )
  {
    parent = pCont;
    fp = new FingerPrint( parent );
  }

  /**
   * Compares the received pPrint with the scanned one
   * @return true if prints matches
   */
  public boolean comparePrints( byte[] pPrint ) throws Exception
  {
//      FileInputStream  l_arch = new FileInputStream( "c:\\prueba.txt" );
//      byte[] l_fPrint = new byte[4096];
//      l_arch.read( l_fPrint );
//      l_arch.close();
  
      // gets & compares user fingerprints
      /*if ( fp.acqLive( pPrint ) )
        return true;*/
    return false;
  }

  /**
   * Registers the user fingerprints into DB
   * @return the user's fingerprint
   */
  public byte[] registerUser() throws Exception
  {
    byte[] l_fPrint = null;

    // scans userCode fingerprint 
//    FileOutputStream  l_arch = new FileOutputStream( "c:\\prueba.txt" );
   // l_fPrint = fp.acqMaster();
//    l_arch.write( l_fPrint );
//    l_arch.close();
System.out.println( "data saved" );

    return l_fPrint;
  }
}


